Reformat the BUILD and re2_test.bzl files. Change-Id: I3abaee5d3f6b6265519ffa78dd9a6d3ea48fa2e8 Reviewed-on: https://code-review.googlesource.com/2362 Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/BUILD b/BUILD index b5a567d..3aebcec 100644 --- a/BUILD +++ b/BUILD
@@ -1,111 +1,100 @@ -# Bazel(http://bazel.io/) build file +# Bazel (http://bazel.io/) BUILD file for RE2. licenses(["notice"]) -# Make stringpiece a standalone lib so it can be used without polling -# other parts of re2. +# stringpiece is a standalone library so that it can be used without pulling in +# all of the other parts of RE2. cc_library( - name = "stringpiece", - visibility = ["//visibility:public"], - hdrs = [ - "re2/stringpiece.h", - ], - srcs = [ - "re2/stringpiece.cc", - ], - includes = [ - "." - ] + name = "stringpiece", + srcs = ["re2/stringpiece.cc"], + hdrs = ["re2/stringpiece.h"], + includes = ["."], + visibility = ["//visibility:public"], ) cc_library( - name = "re2", - visibility = ["//visibility:public"], - hdrs = [ - "re2/filtered_re2.h", - "re2/re2.h", - "re2/set.h", - "re2/variadic_function.h", - ], - deps = [ - ":stringpiece", - ], - includes = [ - ".", - ], - srcs = [ - # Internal headers - "re2/prefilter.h", - "re2/prefilter_tree.h", - "re2/prog.h", - "re2/regexp.h", - "re2/unicode_casefold.h", - "re2/unicode_groups.h", - "re2/walker-inl.h", - "util/atomicops.h", - "util/flags.h", - "util/logging.h", - "util/mutex.h", - "util/sparse_array.h", - "util/sparse_set.h", - "util/utf.h", - "util/util.h", - "util/valgrind.h", - "re2/bitstate.cc", - "re2/compile.cc", - "re2/dfa.cc", - "re2/filtered_re2.cc", - "re2/mimics_pcre.cc", - "re2/nfa.cc", - "re2/onepass.cc", - "re2/parse.cc", - "re2/perl_groups.cc", - "re2/prefilter.cc", - "re2/prefilter_tree.cc", - "re2/prog.cc", - "re2/re2.cc", - "re2/regexp.cc", - "re2/set.cc", - "re2/simplify.cc", - "re2/tostring.cc", - "re2/unicode_casefold.cc", - "re2/unicode_groups.cc", - "util/hash.cc", - "util/rune.cc", - "util/stringprintf.cc", - "util/strutil.cc", - "util/valgrind.cc", - ], - linkopts = [ - "-pthread" - ] + name = "re2", + srcs = [ + "re2/bitstate.cc", + "re2/compile.cc", + "re2/dfa.cc", + "re2/filtered_re2.cc", + "re2/mimics_pcre.cc", + "re2/nfa.cc", + "re2/onepass.cc", + "re2/parse.cc", + "re2/perl_groups.cc", + "re2/prefilter.cc", + "re2/prefilter.h", + "re2/prefilter_tree.cc", + "re2/prefilter_tree.h", + "re2/prog.cc", + "re2/prog.h", + "re2/re2.cc", + "re2/regexp.cc", + "re2/regexp.h", + "re2/set.cc", + "re2/simplify.cc", + "re2/tostring.cc", + "re2/unicode_casefold.cc", + "re2/unicode_casefold.h", + "re2/unicode_groups.cc", + "re2/unicode_groups.h", + "re2/walker-inl.h", + "util/atomicops.h", + "util/flags.h", + "util/hash.cc", + "util/logging.h", + "util/mutex.h", + "util/rune.cc", + "util/sparse_array.h", + "util/sparse_set.h", + "util/stringprintf.cc", + "util/strutil.cc", + "util/utf.h", + "util/util.h", + "util/valgrind.cc", + "util/valgrind.h", + ], + hdrs = [ + "re2/filtered_re2.h", + "re2/re2.h", + "re2/set.h", + "re2/variadic_function.h", + ], + includes = ["."], + linkopts = ["-pthread"], + visibility = ["//visibility:public"], + deps = [ + ":stringpiece", + ], ) -# Test-only libraries cc_library( - name="test", - hdrs = [ - "re2/testing/regexp_generator.h", - "re2/testing/string_generator.h", - "re2/testing/tester.h", - "util/pcre.h", - "util/random.h", - "util/test.h", - ], - srcs = [ - "re2/testing/backtrack.cc", - "re2/testing/dump.cc", - "re2/testing/regexp_generator.cc", - "re2/testing/string_generator.cc", - "re2/testing/tester.cc", - "util/pcre.cc", - "util/random.cc", - "util/test.cc", - ], - testonly = 1, - deps = [ - ":re2", - ], + name = "test", + testonly = 1, + srcs = [ + "re2/testing/backtrack.cc", + "re2/testing/dump.cc", + "re2/testing/regexp_generator.cc", + "re2/testing/string_generator.cc", + "re2/testing/tester.cc", + "util/pcre.cc", + "util/random.cc", + "util/test.cc", + ], + hdrs = [ + "re2/testing/regexp_generator.h", + "re2/testing/string_generator.h", + "re2/testing/tester.h", + "util/pcre.h", + "util/random.h", + "util/test.h", + ], + includes = ["."], + deps = [ + ":re2", + ], ) load("re2_test", "re2_test") @@ -125,6 +114,6 @@ re2_test("simplify_test") re2_test("string_generator_test") -# TODO: support "big" tests as per Makefile, these libraries should be -# compiled too: util/thread.{cc,h} for dfa_test. Oh, and -# re2/testing/exhaustive_tester.{cc,h} for the exhaustive tests. +# TODO: Add the "big" tests from the Makefile. +# util/thread.{cc,h} will be needed for the DFA test. +# re2/testing/exhaustive_tester.{cc,h} will be needed for the exhaustive tests.
diff --git a/re2_test.bzl b/re2_test.bzl index 99e7fbc..a55522c 100644 --- a/re2_test.bzl +++ b/re2_test.bzl
@@ -1,10 +1,10 @@ # Define a bazel macro that creates cc_test for re2. def re2_test(name, deps=[]): native.cc_test( - name = name, - srcs = [ "re2/testing/%s.cc" % (name)], - deps = [ - ":re2", - ":test", - ] + deps + name=name, + srcs=["re2/testing/%s.cc" % (name)], + deps=[ + ":re2", + ":test", + ] + deps )